<!-- 求租 -->
<template>
  <div class="box">
    <div class="box-header">
      <div @click="fanhui">《返回</div>
      <div>团购</div>
      <div></div>
    </div>
    <!-- //// -->
    <div class="Box-bbody">
      <dl v-for="(item, index) in list" :key="(item, index)">
        <div class="B-AbC1">
          <img :src="item.img" alt="" />
        </div>
        <div class="B-AbC2">
          <div class="B-Box1">
            <h5>{{ item.title }}</h5>
          </div>
          <div class="B-Box1">{{ item.tttle }}</div>
          <div class="B-Box1-baoming">
            <span>报名时间：2021-09-07</span>
            <span>报名{{ item.nuue }}/人</span>
          </div>
        </div>
        <div class="B-AbC3">
          <div>
            <van-field name="switch">
              <template #input>
                <van-switch v-model="checked" size="20" />
              </template>
            </van-field>
          </div>
          <div class="kaiguan-tuan">
            <button class="tuan1">开团</button>
            <button class="tuan2">取消</button>
          </div>
        </div>
      </dl>
    </div>
    <!-- /// -->
    <!-- <div class="box-footer">+</div> -->
  </div>
</template>

<script>
import { ref } from "vue";
import request from "../utility/request";
// import { defineComponent } from "vue";
export default {
  //import引入的组件需要注入到对象中才能使用
  components: {},
  data() {
    //这里存放数据
    const checked = ref(false);
    return {
      checked,
      list: [],
    };
  },
  //监听属性 类似于data概念
  computed: {},
  //监控data中的数据变化
  watch: {},
  //方法集合
  methods: {
    fanhui() {
      this.$router.push("/Home");
    },
  },
  //生命周期 - 创建完成（可以访问当前this实例）
  async created() {
    const res = await request("/get1");
    console.log(res.list);
    this.list = res.list;
  },
  //生命周期 - 挂载完成（可以访问DOM元素）
  mounted() {},
};
</script>
<style lang='scss' scoped>
.box {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: paleturquoise;
}
.box-header {
  width: 100%;
  height: 50px;
  color: #fff;
  background: blue;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0px 10px;
}
.Box-bbody {
  width: 100%;
  flex: 1;
  overflow-x: hidden;
  background: rgb(255, 255, 255);
}
.Box-bbody dl {
  // padding: 0px 20px;
  width: 100%;
  height: 320px;
  // background: rgb(255, 186, 186);
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid #ccc;
}
.B-AbC1 {
  width: 100%;
  height: 200px;
  // background: red;
}
.B-AbC1 img {
  width: 100%;
  height: 200px;
}
.B-AbC2 {
  width: 100%;
  height: 70px;
}
.B-Box1-baoming {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.B-AbC3 {
  width: 100%;
  height: 50px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgb(255, 255, 255);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.B-AbC3 .span1 {
  color: orange;
  font-size: 20px;
}
.B-AbC3 .span2 {
  color: rgb(175, 175, 174);
  // font-size: 20px;
}
.kaiguan-tuan {
  width: 100px;
  height: 50px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.kaiguan-tuan button {
  width: 40px;
  height: 30px;
  outline: none;
  border: none;
}
.tuan1 {
  background: rgb(0, 174, 255);
  color: #fff;
}
.tuan2 {
  background: rgb(204, 204, 204);
  color: #000;
}
/////////////////////
// .box-footer {
//   color: #fff;
//   font-size: 50px;
//   margin-top: 70%;
//   margin-left: 80%;
//   width: 50px;
//   height: 50px;
//   background: rgb(4, 125, 224);
//   text-align: center;
//   line-height: 50px;
//   border-radius: 50%;
//   position: absolute;
// }
// .box-footer:hover {
//   color: #000;
//   background: rgb(0, 255, 170);
// }
</style>
